import http from '../..';

const prefix = '/ncov/tasks';

/**
 * 获取溯源结果分型信息
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getTraceType = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/typing-results`);

/**
 * 获取溯源结果phyd3数据
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getTraceTree = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/phylo-tree`);

/**
 * 获取溯源分析表格数据
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getTraceTable = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/trace-table`);

/**
 * 获取变异信息列表
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getMutationInfo = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/mutation-info`);

/**
 * 获取基因组覆盖度表格数据
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getCoverageTable = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/coverage-summary`);

/**
 * 获取基因组覆盖度图表数据
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getCoverageChart = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/line-chart`);

/**
 * 获取基因组序列列表
 * @param taskId 任务id
 * @param barcodeId
 * @param width 文本宽度
 * @returns
 */
export const getMedaka = (taskId: string, barcodeId: string, width: number) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/gene-order?width=${width}`);

/**
 * 获取数据统计列表
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getNanoStats = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/nano-stats`);

  /**
 * 获取数据统计列表
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getMappedNanoStats = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/mapped-nano-stats`);